<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>转让书籍搜索：{{ $search_text }} - 夜读书</title>
    <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="夜读书">
    <meta name="description" content="夜读书书城，图书赠送，交换，出售。">
    <meta name="keywords" content="夜读书，书城，图书赠送，交换，出售。">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/mobile.css') }}">    
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
</head>
<body>
@include('mobile.nav')
<div id="shoplist">

    <div class="search">@include('mobile.navshopsearch_txt')</div>
    <div class="shop">
    @if ($bags->count() != 0)
        @foreach($bags as $bag)
            @if($bag->condition == 10)
                <?php $condition = '全新'; ?>
            @endif
            @if($bag->condition == 9)
                <?php $condition = '9成新'; ?>
            @endif
            @if($bag->condition == 8)
                <?php $condition = '8成新'; ?>
            @endif
            @if($bag->condition == 7)
                <?php $condition = '7成新'; ?>
            @endif
            @if($bag->condition == 6)
                <?php $condition = '6成新'; ?>
            @endif
            @if($bag->condition == 5)
                <?php $condition = '5成新'; ?>
            @endif
            @if($bag->condition == 0)
                <?php $condition = '较旧'; ?>
            @endif 

            @if($bag->scope == 'L')
                <?php $scope = "同城"; ?>
            @endif
            @if($bag->scope == 'R')
                <?php $scope = "不限"; ?>
            @endif
            
            {{-- J借阅，E交换，S出售，Z赠送，B以上均可 --}}
            @if($bag->otype == 'J')
                    <?php $otype_txt = '借阅'; ?>
            @elseif($bag->otype == 'E')
                    <?php $otype_txt = '交换'; ?>
            @elseif($bag->otype == 'S')
                    <?php $otype_txt = '￥' . $bag->nowprice; ?>
            @elseif($bag->otype == 'Z')
                    <?php $otype_txt = '赠送'; ?>
            @else
                    <?php $otype_txt = '￥' . $bag->nowprice; ?>
            @endif

            @if($bag->users->sex == 1)
                    <?php $sex = "images/ico/male.png"; ?>
            @endif
            @if($bag->users->sex == 2)
                    <?php $sex = "images/ico/female.png"; ?>
            @endif
            @if($bag->users->sex == 3)
                    <?php $sex = "images/ico/sex_unknow.png"; ?>
            @endif

            @if($bag->users->avatar_file_min != '')
                     <?php $touxiang = "http://www.yedushu.com/" . $bag->users->avatar_file_min; ?>
            @else
                     <?php $touxiang = "http://www.yedushu.com/usersface/default/avatar-min.png"; ?>
            @endif           
        <div class="mod">
            <div class="userinfo">
                <span class="bimg"><a href="{{url('mobile/uhome/'.$bag->users->uid)}}"><img src="{{$touxiang}}"></img></a></span>
                <span class="sex"><img class="aligncenter" src="{{url($sex)}}"></img></span>
                <span class="txt txtalign"><a href="{{url('mobile/uhome/'.$bag->users->uid)}}">{{$bag->users->user_name}}</a></span>
                <span class="txt">{{$bag->users->province}}{{$bag->users->city}}</span>
            </div>
            <a href="{{url('mobile/shopinfo')}}/{{$bag->id}}">
            <div class="item">            
                <img class="bimg" style="float:left;" src="http://www.yedushu.com/{{$bag->books->bimg}}"></img>  
                <dl style="margin-left: 5em;">
                    <dt class="bookname">{{$bag->books->book_name}}</dt>
                    <dt class="zuozhe"><span>{{$bag->books->zuozhe}} | {{$bag->books->chubanshe}}</span></dt>
                    <dt class="jiage"><span class="nowprice">{{$otype_txt}}</span> <span class="price">￥{{$bag->books->dingjia}}</span></dt>
                    <dt class="oth">
                        <span><img src="{{url('images/ico/date.png')}}"></img> {{date('m-d', $bag->add_time)}}</span>
                        <span><img src="{{url('images/ico/comment.png')}}"></img> {{$bag->liuyancount}}</span>
                        <span><img src="{{url('images/ico/quality.png')}}"></img> {{$condition}}</span>
                        <span><img src="{{url('images/ico/personal_my_address.png')}}"></img> {{$scope}}</span>
                    </dt>
                </dl>
                <div style="clear:both"></div>
            </div>
        </div>
        </a>       
        @endforeach
    </div>
    <div class="simplePaginate"> 
        {!! $bags->appends(['search_text' => $search_text])->render() !!}
    </div>
    @else
        您搜索的图书暂时没有人转让！
    @endif
        
</div> 

@include('mobile.footer')
</body>
</html>